package com.isunland.managesystem.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import com.isunland.managesystem.base.BaseFragment;
import com.isunland.managesystem.base.BaseVolleyActivity;
import com.isunland.managesystem.entity.BaseParams;
import java.io.Serializable;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/5/24 16:33
 */
public class BaseDialogFragment extends DialogFragment {

  public BaseVolleyActivity mActivity;
  public BaseParams mBaseParams;

  public static DialogFragment newInstance(BaseParams params, DialogFragment fragment) {
    Bundle args = new Bundle();
    args.putSerializable(BaseFragment.EXTRA_PARAMS, params);
    fragment.setArguments(args);
    return fragment;
  }

  @Override public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mActivity = (BaseVolleyActivity) getActivity();
    if (getArguments() != null) {
      Serializable ser = getArguments().getSerializable(BaseFragment.EXTRA_PARAMS);
      if (ser != null && ser instanceof BaseParams) {
        mBaseParams = (BaseParams) ser;
      }
    }
    if (mBaseParams == null) {

      mBaseParams = new BaseParams();
    }
    initData();
  }

  public void initData() {
  }
}
